#!/usr/bin/env python3
import psutil
import platform
import datetime
import GPUtil

def brief_info():
    out_str = ""
    cpu_percent = psutil.cpu_percent()
    memory_percent = psutil.virtual_memory()[2]
    disk_info = ""
    for part in psutil.disk_partitions(all=False):
        usage = psutil.disk_usage(part.mountpoint)
        disk_info += str("  %s used %s percent. \n" % (part.device, usage.percent))
    boot_time = datetime.datetime.fromtimestamp(psutil.boot_time())
    running_since = boot_time.strftime("%A %d. %B %Y")
    gpu_info = GPUtil.getUtilization()
    out_str += "current disk_info is:\n%s" % disk_info
    out_str += "current CPU utilization is %s percent.  \n" % cpu_percent
    out_str += "current memory utilization is %s percent. \n" % memory_percent
    out_str += "sytem running since %s.\n" % running_since
    out_str += "current GPU utilization is\n %s" % gpu_info
    
    return out_str
if __name__ == '__main__':
    print(brief_info())